function after_simulation()

global log_id;
global system_mode;
global compare_policies;

if strcmp(system_mode,'learn') || strcmp(system_mode,'load')
    SavePolicy();
elseif strcmp(system_mode, 'follow')
    SaveResults();
    if compare_policies
        fprintf(log_id, strcat('End Time:', datestr(now), '\n'));
    end
end

end